<template>
  <div class="callback">
    <h2>处理登录中...</h2>
  </div>
</template>

<script>
import { mapActions } from 'vuex'

export default {
  name: 'Callback',
  async created() {
    try {
      await this.handleCallback()
      this.$router.push('/')
    } catch (error) {
      console.error('登录失败:', error)
      this.$router.push('/login')
    }
  },
  methods: {
    ...mapActions(['handleCallback'])
  }
}
</script>

<style scoped>
.callback {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}
</style> 